var validation = {

    newCliData: function(cliForm){
        var name = cliForm.cliNameInput.value,
            phone = cliForm.cliPhoneInput.value,
            born = cliForm.cliDateInput.value,
            doc = cliForm.cliDocInput.value,
            //genre = cliForm.cliGenreSelect.value,
            street = cliForm.cliStreetInput.value,
            numb = cliForm.cliNumbInput.value,
            neig = cliForm.cliNeigInput.value,
            zip = cliForm.cliZipInput.value,
            state = cliForm.cliStateInput.value,
            newCli = new Array(name, phone, born, doc, street, numb, neig, zip, state),
            error = document.getElementById('newCliError'),
            flag = true;
            
            error.innerHTML = "";

            for(var x=0; x<9; x++){
                if(newCli[x] == ""){
                    flag = false;
                    error.innerHTML = "<div id='error'>Por Favor Preencha Todos os Campos</div>";
                    break;
                }
            }
            return flag;
    },
    
    showMapData: function(address){
        var street = address.cliStreetInput.value,
            numb = address.cliNumbInput.value,
            zip = address.cliZipInput.value,
            state = address.cliStateInput.value,
            map = new Array(street, numb, zip, state),
            error = document.getElementById('newCliError'),
            flag = true;
            
            error.innerHTML = "";

            for(var x=0; x<4; x++){
                if(map[x] == ""){
                    flag = false;
                    error.innerHTML = "<div id='error'>Para Mostrar o Mapa Preencha todos os Campos do Endereço</div>";
                    break;
                }
            }
            return flag;
    },
    
    newCarData: function(carForm){
        var model = carForm.carModelInput.value,
            mark = carForm.carMarkInput.value,
            color = carForm.carColorInput.value,
            license = carForm.carLicenseInput.value,
            year = carForm.carYearInput.value,
            newCar = new Array(model,mark, color, license, year),
            error = document.getElementById('newCarError'),
            flag = true;
            
            error.innerHTML = "";

            for(var x=0; x<4; x++){
                if(newCar[x] == ""){
                    flag = false;
                    error.innerHTML = "<div id='error'>Por Favor Preencha Todos os Campos</div>";
                }
            }
            return flag;
    },
    
    newParkData: function(parkForm){
        var car = parkForm.parkCliInput.value,
            client = parkForm.parkCarInput.value,
            newPark = new Array(car, client),
            error = document.getElementById('newParkError'),
            flag = true;
            
            error.innerHTML = "";

            for(var x=0; x<1; x++){
                if(newPark[x] == ""){
                    flag = false;
                    
                    if(newPark[0] == ""){
                        error.innerHTML = "<div id='error'>Campo PLACA DO CARRO Obrigatório!</div>";
                    }
                    
                    if(newPark[1] == ""){
                        error.innerHTML = "<div id='error'>Campo CLIENTE Obrigatório!</div>";
                    }
                    
                }
            }
            return flag;
    },
    
    exitData: function(form){
        var client = form.parkCliInput.value,
            cpf = form.parkCpfResInput.value,
            model = form.parkModelInput.value,
            mark = form.parkMarkInput.value,
            plaque = form.parkCarInput.value,
            year = form.parkYearInput.value,
            newCar = new Array(client, cpf, model, mark, plaque, year),
            error = document.getElementById('exitParkError'),
            flag = true;
            
            error.innerHTML = "";

            for(var x=0; x<4; x++){
                if(newCar[x] == ""){
                    flag = false;
                    error.innerHTML = "<div id='error'>Por Favor Preencha Todos os Campos</div>";
                }
            }
            return flag;
    },
    
    fareData: function(form){
        var tax = form.taxInput.value,
            desc = form.descriptionInput.value,
            newFare = new Array(tax, desc),
            error = document.getElementById('newFareError'),
            flag = true;
            
            error.innerHTML = "";

            for(var x=0; x<2; x++){
                if(newFare[x] == ""){
                    flag = false;
                    error.innerHTML = "<div id='error'>Por Favor Preencha Todos os Campos</div>";
                }
            }
            return flag;
    }
};